Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go mod: add indirect version of shirou/gopsutil to fix freebsd build #1385

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

amyangfei
Copy link
Contributor

@amyangfei amyangfei commented Jan 31, 2021

What problem does this PR solve?

Fix build failure in darwin/freebsd, related to shirou/gopsutil#853, shirou/gopsutil#958. master branch is ok

[2021-01-30T03:02:49.692Z] + make build
[2021-01-30T03:02:49.692Z] CGO_ENABLED=0 GO111MODULE=on go build  -trimpath  -ldflags '-X "github.com/pingcap/ticdc/pkg/version.ReleaseVersion=v4.0.11" -X "github.com/pingcap/ticdc/pkg/version.BuildTS=2021-01-30 03:02:49" -X "github.com/pingcap/ticdc/pkg/version.GitHash=f9ecdb2b448419d0770b44c579ef96c9d58bcac7" -X "github.com/pingcap/ticdc/pkg/version.GitBranch=heads/refs/tags/v4.0.11" -X "github.com/pingcap/ticdc/pkg/version.GoVersion=go version go1.13.4 darwin/amd64"' -o bin/cdc ./main.go
[2021-01-30T03:03:46.787Z] # github.com/shirou/gopsutil/disk
[2021-01-30T03:03:46.787Z] /Users/pingcap/gopkg/pkg/mod/github.com/shirou/gopsutil@v2.20.3+incompatible/disk/disk_darwin.go:67:51: cannot use stat.Mntfromname[:] (type []byte) as type []int8 in argument to common.IntToString
[2021-01-30T03:03:46.787Z] /Users/pingcap/gopkg/pkg/mod/github.com/shirou/gopsutil@v2.20.3+incompatible/disk/disk_darwin.go:68:49: cannot use stat.Mntonname[:] (type []byte) as type []int8 in argument to common.IntToString
[2021-01-30T03:03:46.787Z] /Users/pingcap/gopkg/pkg/mod/github.com/shirou/gopsutil@v2.20.3+incompatible/disk/disk_darwin.go:69:50: cannot use stat.Fstypename[:] (type []byte) as type []int8 in argument to common.IntToString
[2021-01-30T03:03:46.787Z] /Users/pingcap/gopkg/pkg/mod/github.com/shirou/gopsutil@v2.20.3+incompatible/disk/disk_darwin.go:85:43: cannot use stat.Fstypename[:] (type []byte) as type []int8 in argument to common.IntToString
[2021-01-30T03:03:46.787Z] make: *** [cdc] Error 2
script returned exit code 2

What is changed and how it works?

github.com/shirou/gopsutil is used in github.com/pingcap/sysutil, since 3.x and 2.x of gopsutil are not compatible, this is a workaround for ticdc build.

The root cause is github.com/shirou/gopsutil must be compatible with golang.org/x/sys

It is better to upgrade github.com/shirou/gopsutil in github.com/pingcap/sysutil, and the dependency in pd/tidb will be updated cascade

Check List

Tests

  • Unit test
  • Integration test

Release note

  • No release note

@amyangfei amyangfei added this to the v4.0.11 milestone Jan 31, 2021
@amyangfei
Copy link
Contributor Author

/run-all-tests

@amyangfei amyangfei added the status/ptal Could you please take a look? label Jan 31, 2021
@codecov-io
Copy link

Codecov Report

Merging #1385 (f9ecdb2) into release-4.0 (f9ecdb2) will not change coverage.
The diff coverage is n/a.

@@              Coverage Diff               @@
##           release-4.0      #1385   +/-   ##
==============================================
  Coverage      48.5304%   48.5304%           
==============================================
  Files              130        130           
  Lines            13235      13235           
==============================================
  Hits              6423       6423           
  Misses            6134       6134           
  Partials           678        678           

@zier-one
Copy link
Contributor

zier-one commented Feb 1, 2021

/lgtm

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 1, 2021
@zier-one
Copy link
Contributor

zier-one commented Feb 1, 2021

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 1, 2021
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 8c698e0 into pingcap:release-4.0 Feb 1, 2021
@amyangfei amyangfei deleted the fix-build-darwin branch February 1, 2021 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. status/ptal Could you please take a look?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants